<!--
Issue 662
Test that xhrs excluded from instrumentation don't cause SPA to wait indefinitely
-->
<%= header %>
<%= boomerangScript %>
<base href="/pages/05-angular/" />
<script src="../../vendor/angular/angular.js"></script>
<script src="../../vendor/angular-resource/angular-resource.js"></script>
<script src="../../vendor/angular-route/angular-route.js"></script>
<script>
window.angular_imgs = [3000];

window.angular_html5_mode = false;

// view a widget then come back so debugging (F5) is easier
window.angular_nav_routes = ["/widgets/1", "/"];

window.BOOMR = window.BOOMR || {};
window.BOOMR.xhr_excludes = {
	"/pages/05-angular/support/img.jpg": true
};
</script>
<script src="support/app.js"></script>
<div ng-app="app">
	<div ng-view>
	</div>
</div>
<script src="116-autoxhr-xhrexcludes.js" type="text/javascript"></script>
<script>
BOOMR.subscribe("spa_init", function() {
	// send an xhr during a spa navigation
	setTimeout(function() {
		// this xhr should match the exclude filter
		var xhr = new XMLHttpRequest();
		xhr.open("GET", "/pages/05-angular/support/img.jpg?rnd=" + Math.random());
		xhr.send(null);
	}, 100);
});
BOOMR_test.init({
	testAfterOnBeacon: 3,
	Angular: {
		enabled: true
	},
	instrument_xhr: true,
	autorun: false
});

// Timeout after 30s in case auto xhr is still waiting for a resource
window.timerid = setTimeout(function() {
	BOOMR_test.runTests();
}, 30000);

</script>
<%= footer %>
